﻿
namespace SistemaLogistica.Business.Logic
{
    using System;
    using System.Collections.Generic;
    using SistemaLogistica.Business.Entities;
    using SistemaLogistica.DataAccess;

    public class AlquilerVehiculoManager
    {
        private AlquilerVehiculoManager() { }

        private static readonly AlquilerVehiculoManager instancia = new AlquilerVehiculoManager();

        public static AlquilerVehiculoManager Instancia
        {
            get { return instancia; }
        }

        public List<AlquilerVehiculo> Listar()
        {
            try
            {
                return AlquilerVehiculoData.Instancia.Listar();
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }

        public List<AlquilerVehiculo> ListarPorFecha(int idProveedor, DateTime fecha)
        {
            try
            {
                return AlquilerVehiculoData.Instancia.ListarPorFecha(idProveedor, fecha);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }

        public void Registrar(List<AlquilerVehiculo> alquiler)
        {
            try
            {
                AlquilerVehiculoData.Instancia.Registrar(alquiler);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }

        public void Modificar(List<AlquilerVehiculo> alquiler)
        {
            try
            {
                AlquilerVehiculoData.Instancia.Modificar(alquiler);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }

        public void Eliminar(int idProveedor, DateTime fecha)
        {
            try
            {
                AlquilerVehiculoData.Instancia.Eliminar(idProveedor, fecha);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
    }
}
